﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Tetris
{

   public class Blocks           // Игровые блоки

    {
       public int X { get; set; }
       public int Y { get; set; }
       private List<PieceOfBlocks> piecesOfBlocks { get; set; }
       private GameField mainGameField { get; set; }
      // private List<PieceOfBlocks> newBlock = new List<PieceOfBlocks>();
       private PieceOfBlocks firstPiece { get; set; }



       public virtual List<PieceOfBlocks> Position1(int x, int y)
       {
           firstPiece.X = x;
           firstPiece.Y = y;
         return piecesOfBlocks;
       }

       public virtual void Position2(int x, int y)
       {
           firstPiece.X = x;
           firstPiece.Y = y;

       }

       public virtual void Position3(int x, int y)
       {
           firstPiece.X = x;
           firstPiece.Y = y;

       }

       public virtual void Position4(int x, int y)
       {
           firstPiece.X = x;
           firstPiece.Y = y;
       }
      /* public List<PieceOfBlocks> SquareBlock(GameField field, int x, int y)
        {
           this.mainGameField = field;
           this.X = x;//mainGameField.centreX - 1;
           this.Y = y;//mainGameField.width - mainGameField.width + 1;
          //  this.mainGameField = field;
           PieceOfBlocks piece1 = new PieceOfBlocks(X, Y);
           PieceOfBlocks piece2 = new PieceOfBlocks(piece1.X+1, piece1.Y);
           PieceOfBlocks piece3 = new PieceOfBlocks(piece1.X + 1, piece1.Y+1);
           PieceOfBlocks piece4 = new PieceOfBlocks(piece1.X, piece1.Y+1);
           List<PieceOfBlocks> square = new List<PieceOfBlocks>();
           square.Add(piece1);
           square.Add(piece2);
           square.Add(piece3);
           square.Add(piece4);
           return square;
        }

       public List<PieceOfBlocks> PyramidBlock()
       {
           PieceOfBlocks piece1 = new PieceOfBlocks(10, 15);
           PieceOfBlocks piece2 = new PieceOfBlocks(piece1.X-1, piece1.Y);
           PieceOfBlocks piece3 = new PieceOfBlocks(piece1.X+1, piece1.Y);
           PieceOfBlocks piece4 = new PieceOfBlocks(piece1.X, piece1.Y+1);
           List<PieceOfBlocks> pyramid = new List<PieceOfBlocks>();
           pyramid.Add(piece1);
           pyramid.Add(piece2);
           pyramid.Add(piece3);
           pyramid.Add(piece4);
           return pyramid;
       }
        public List<PieceOfBlocks> LineBlock()
       {
           PieceOfBlocks piece1 = new PieceOfBlocks(5, 15);
           PieceOfBlocks piece2 = new PieceOfBlocks(piece1.X-1, piece1.Y);
           PieceOfBlocks piece3 = new PieceOfBlocks(piece1.X + 1, piece1.Y);
           PieceOfBlocks piece4 = new PieceOfBlocks(piece1.X+2, piece1.Y);
           List<PieceOfBlocks> line = new List<PieceOfBlocks>();
           line.Add(piece1);
           line.Add(piece2);
           line.Add(piece3);
           line.Add(piece4);
           return line;
       }

       public List<PieceOfBlocks> Z_Block()
        {
            PieceOfBlocks piece1 = new PieceOfBlocks(5, 10);
            PieceOfBlocks piece2 = new PieceOfBlocks(piece1.X - 1, piece1.Y);
            PieceOfBlocks piece3 = new PieceOfBlocks(piece1.X , piece1.Y + 1);
            PieceOfBlocks piece4 = new PieceOfBlocks(piece1.X + 1, piece1.Y + 1);
            List<PieceOfBlocks> z_block = new List<PieceOfBlocks>();
            z_block.Add(piece1);
            z_block.Add(piece2);
            z_block.Add(piece3);
            z_block.Add(piece4);
            return z_block;
        }
       
       public List<PieceOfBlocks> StrangeBlock()
       {
           PieceOfBlocks piece1 = new PieceOfBlocks(10, 10);
           PieceOfBlocks piece2 = new PieceOfBlocks(piece1.X + 1, piece1.Y);
           PieceOfBlocks piece3 = new PieceOfBlocks(piece1.X + 1 , piece1.Y + 1);
           PieceOfBlocks piece4 = new PieceOfBlocks(piece1.X - 1 , piece1.Y);
           List<PieceOfBlocks> strange = new List<PieceOfBlocks>();
           strange.Add(piece1);
           strange.Add(piece2);
           strange.Add(piece3);
           strange.Add(piece4);
           return strange;
       }*/

    }


   public class PieceOfBlocks
   {
        public  PieceOfBlocks(int x, int y)
        {
            X = x;
            Y = y;
        }

        public int X { get; set; }
        public int Y { get; set; }
   }
   
    
}
